package Day6Zuoye.Circle;

public class Triangle extends Image {
    private int a,b,c;

    public Triangle(int a, int b, int c) {
        this.a = a;
        this.b = b;
        this.c = c;
    }


    @Override

    public double area(){
        double result = 0.0;
        result = Math.sqrt((a+b+c)/2*((a+b+c)/2-a)*((a+b+c)/2-b)*((a+b+c)/2-c));
        System.out.println("面积是"+result);
        return result;
    }

    @Override
    public double perimeter(){
        double result = 0.0;
        result = a+b+c;
        System.out.println("周长是"+result);
        return result;
    }
}
